﻿// License: The MIT License (MIT) Copyright (c) 2011..2012 Barend Gehrels

// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

using System.Windows;
using System.Windows.Media.Imaging;

namespace GrooveSharp
{

    // Create a private adaption, having dependancy properties
    public class TrackInfo : DependencyObject
    {
        #region PROPERTY REGISTRATION
        public static readonly DependencyProperty
            PlayingProperty = DependencyProperty.Register("Playing",
                typeof(bool), typeof(TrackInfo),
                    new UIPropertyMetadata(null));
        public static readonly DependencyProperty
            TitleProperty = DependencyProperty.Register("Title",
                typeof(string), typeof(TrackInfo),
                    new UIPropertyMetadata(null));
        public static readonly DependencyProperty
            ArtistProperty = DependencyProperty.Register("Artist",
                typeof(string), typeof(TrackInfo),
                    new UIPropertyMetadata(null));
        public static readonly DependencyProperty
            AlbumProperty = DependencyProperty.Register("Album",
                typeof(string), typeof(TrackInfo),
                    new UIPropertyMetadata(null));
        public static readonly DependencyProperty
            YearProperty = DependencyProperty.Register("Year",
                typeof(string), typeof(TrackInfo),
                    new UIPropertyMetadata(null));
        public static readonly DependencyProperty
            RatingProperty = DependencyProperty.Register("Rating",
                typeof(int), typeof(TrackInfo),
                    new UIPropertyMetadata(null));
        #endregion

        public int Id { get; set; }

        public bool Playing
        {
            get { return (bool)GetValue(PlayingProperty); }
            set { SetValue(PlayingProperty, value); }
        }

        public string Title
        {
            get { return (string)GetValue(TitleProperty); }
            set { SetValue(TitleProperty, value); }
        }

        public string Artist
        {
            get { return (string)GetValue(ArtistProperty); }
            set { SetValue(ArtistProperty, value); }
        }

        public string Album
        {
            get { return (string)GetValue(AlbumProperty); }
            set { SetValue(AlbumProperty, value); }
        }

        public string Year
        {
            get { return (string)GetValue(YearProperty); }
            set { SetValue(YearProperty, value); }
        }

        public int Rating
        {
            get { return (int)GetValue(RatingProperty); }
            set { SetValue(RatingProperty, value); }
        }

        public string Genre { get; set; }
        public string FileName { get; set; }
        public BitmapImage Image { get; set; }
    }

}
